﻿import QtQuick 2.12
import QtQuick.Window 2.12
import QtQuick.Controls 2.12

Window {
    id:mainWindow
    width:400
    height: 200
    visible: true
    title: qsTr("note")

    ListModel{
        id: moTest
        ListElement{
            name:1
        }
    }

    Rectangle{
        height: parent.height
        width: 100
        color:'red'
        anchors.left: parent.left
        anchors.top :parent.top
        anchors.bottom: parent.bottom

        ListView{
            model :moTest
            anchors.fill: parent
            clip: true

            delegate: Rectangle{
                border.color: 'black'
                width: parent.width+50
                implicitWidth: parent.width+50
                height: 30
                Text {
                    text: name
                }

            }
            Component.onCompleted: {
                for(let i=0;i<100;i++){
                    moTest.append({name:i})
                }
            }
            ScrollBar.vertical: ScrollBar{}
            ScrollBar.horizontal: ScrollBar{}
            flickableDirection: Flickable.HorizontalAndVerticalFlick
        }
    }
}

